﻿Public Partial Class ListingDetail
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If String.IsNullOrEmpty(Request.QueryString("auctionID")) Then
            Response.Redirect("Listings.aspx")
        End If
        If Not Page.IsPostBack Then
            Dim db As New AuctionInfoDataContext
            Dim query As Integer = (From au In db.Auctions _
                        Where au.auctionID = Request.QueryString("auctionID") _
                        Select au).Count

            If query <= 0 Then
                Response.Redirect("Listings.aspx")
            End If
        End If
    End Sub

End Class